Integrand size = 24, antiderivative size = 116 \[ \int \frac {\tan ^2(c+d x)}{(a+i a \tan (c+d x))^4} \, dx=-\frac {x}{16 a^4}-\frac {i}{8 d (a+i a \tan (c+d x))^4}+\frac {i}{4 a d (a+i a \tan (c+d x))^3}-\frac {i}{16 d \left (a^2+i a^2 \tan (c+d x)\right )^2}-\frac {i}{16 d \left (a^4+i a^4 \tan (c+d x)\right )} \]
-1/16*x/a^4-1/8*I/d/(a+I*a*tan(d*x+c))^4+1/4*I/a/d/(a+I*a*tan(d*x+c))^3-1/ 16*I/d/(a^2+I*a^2*tan(d*x+c))^2-1/16*I/d/(a^4+I*a^4*tan(d*x+c))
Time = 0.49 (sec) , antiderivative size = 69, normalized size of antiderivative = 0.59 \[ \int \frac {\tan ^2(c+d x)}{(a+i a \tan (c+d x))^4} \, dx=-\frac {(\cos (4 (c+d x))-i \sin (4 (c+d x))) (-4 i+(i+8 d x) \cos (4 (c+d x))+(1+8 i d x) \sin (4 (c+d x)))}{128 a^4 d} \]
-1/128*((Cos[4*(c + d*x)] - I*Sin[4*(c + d*x)])*(-4*I + (I + 8*d*x)*Cos[4* (c + d*x)] + (1 + (8*I)*d*x)*Sin[4*(c + d*x)]))/(a^4*d)
Time = 0.52 (sec) , antiderivative size = 127, normalized size of antiderivative = 1.09, number of steps used = 9, number of rules used = 9, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.375, Rules used = {3042, 4023, 3042, 4009, 3042, 3960, 3042, 3960, 24}
Below are the steps used by Rubi to obtain the solution. The rule number used for the transformation is given above next to the arrow. The rules definitions used are listed below.
\(\displaystyle \int \frac {\tan ^2(c+d x)}{(a+i a \tan (c+d x))^4} \, dx\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \int \frac {\tan (c+d x)^2}{(a+i a \tan (c+d x))^4}dx\) |
\(\Big \downarrow \) 4023 |
\(\displaystyle \frac {\int \frac {a-2 i a \tan (c+d x)}{(i \tan (c+d x) a+a)^3}dx}{2 a^2}-\frac {i}{8 d (a+i a \tan (c+d x))^4}\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \frac {\int \frac {a-2 i a \tan (c+d x)}{(i \tan (c+d x) a+a)^3}dx}{2 a^2}-\frac {i}{8 d (a+i a \tan (c+d x))^4}\) |
\(\Big \downarrow \) 4009 |
\(\displaystyle \frac {\frac {i a}{2 d (a+i a \tan (c+d x))^3}-\frac {1}{2} \int \frac {1}{(i \tan (c+d x) a+a)^2}dx}{2 a^2}-\frac {i}{8 d (a+i a \tan (c+d x))^4}\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \frac {\frac {i a}{2 d (a+i a \tan (c+d x))^3}-\frac {1}{2} \int \frac {1}{(i \tan (c+d x) a+a)^2}dx}{2 a^2}-\frac {i}{8 d (a+i a \tan (c+d x))^4}\) |
\(\Big \downarrow \) 3960 |
\(\displaystyle \frac {\frac {1}{2} \left (-\frac {\int \frac {1}{i \tan (c+d x) a+a}dx}{2 a}-\frac {i}{4 d (a+i a \tan (c+d x))^2}\right )+\frac {i a}{2 d (a+i a \tan (c+d x))^3}}{2 a^2}-\frac {i}{8 d (a+i a \tan (c+d x))^4}\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \frac {\frac {1}{2} \left (-\frac {\int \frac {1}{i \tan (c+d x) a+a}dx}{2 a}-\frac {i}{4 d (a+i a \tan (c+d x))^2}\right )+\frac {i a}{2 d (a+i a \tan (c+d x))^3}}{2 a^2}-\frac {i}{8 d (a+i a \tan (c+d x))^4}\) |
\(\Big \downarrow \) 3960 |
\(\displaystyle \frac {\frac {1}{2} \left (-\frac {\frac {\int 1dx}{2 a}+\frac {i}{2 d (a+i a \tan (c+d x))}}{2 a}-\frac {i}{4 d (a+i a \tan (c+d x))^2}\right )+\frac {i a}{2 d (a+i a \tan (c+d x))^3}}{2 a^2}-\frac {i}{8 d (a+i a \tan (c+d x))^4}\) |
\(\Big \downarrow \) 24 |
\(\displaystyle \frac {\frac {i a}{2 d (a+i a \tan (c+d x))^3}+\frac {1}{2} \left (-\frac {\frac {x}{2 a}+\frac {i}{2 d (a+i a \tan (c+d x))}}{2 a}-\frac {i}{4 d (a+i a \tan (c+d x))^2}\right )}{2 a^2}-\frac {i}{8 d (a+i a \tan (c+d x))^4}\) |
(-1/8*I)/(d*(a + I*a*Tan[c + d*x])^4) + (((I/2)*a)/(d*(a + I*a*Tan[c + d*x ])^3) + ((-1/4*I)/(d*(a + I*a*Tan[c + d*x])^2) - (x/(2*a) + (I/2)/(d*(a + I*a*Tan[c + d*x])))/(2*a))/2)/(2*a^2)
3.1.79.3.1 Defintions of rubi rules used
Int[((a_) + (b_.)*tan[(c_.) + (d_.)*(x_)])^(n_), x_Symbol] :> Simp[a*((a + b*Tan[c + d*x])^n/(2*b*d*n)), x] + Simp[1/(2*a) Int[(a + b*Tan[c + d*x])^ (n + 1), x], x] /; FreeQ[{a, b, c, d}, x] && EqQ[a^2 + b^2, 0] && LtQ[n, 0]
Int[((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(m_)*((c_.) + (d_.)*tan[(e_.) + (f_.)*(x_)]), x_Symbol] :> Simp[(-(b*c - a*d))*((a + b*Tan[e + f*x])^m/(2*a *f*m)), x] + Simp[(b*c + a*d)/(2*a*b) Int[(a + b*Tan[e + f*x])^(m + 1), x ], x] /; FreeQ[{a, b, c, d, e, f}, x] && NeQ[b*c - a*d, 0] && EqQ[a^2 + b^2 , 0] && LtQ[m, 0]
Int[((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(m_)*((c_.) + (d_.)*tan[(e_.) + (f_.)*(x_)])^2, x_Symbol] :> Simp[(-b)*(a*c + b*d)^2*((a + b*Tan[e + f*x])^ m/(2*a^3*f*m)), x] + Simp[1/(2*a^2) Int[(a + b*Tan[e + f*x])^(m + 1)*Simp [a*c^2 - 2*b*c*d + a*d^2 - 2*b*d^2*Tan[e + f*x], x], x], x] /; FreeQ[{a, b, c, d, e, f}, x] && NeQ[b*c - a*d, 0] && LeQ[m, -1] && EqQ[a^2 + b^2, 0]
Time = 0.40 (sec) , antiderivative size = 44, normalized size of antiderivative = 0.38
method | result | size |
risch | \(-\frac {x}{16 a^{4}}+\frac {i {\mathrm e}^{-4 i \left (d x +c \right )}}{32 a^{4} d}-\frac {i {\mathrm e}^{-8 i \left (d x +c \right )}}{128 a^{4} d}\) | \(44\) |
derivativedivides | \(-\frac {\arctan \left (\tan \left (d x +c \right )\right )}{16 d \,a^{4}}+\frac {i}{16 d \,a^{4} \left (\tan \left (d x +c \right )-i\right )^{2}}-\frac {i}{8 d \,a^{4} \left (\tan \left (d x +c \right )-i\right )^{4}}-\frac {1}{4 d \,a^{4} \left (\tan \left (d x +c \right )-i\right )^{3}}-\frac {1}{16 d \,a^{4} \left (\tan \left (d x +c \right )-i\right )}\) | \(95\) |
default | \(-\frac {\arctan \left (\tan \left (d x +c \right )\right )}{16 d \,a^{4}}+\frac {i}{16 d \,a^{4} \left (\tan \left (d x +c \right )-i\right )^{2}}-\frac {i}{8 d \,a^{4} \left (\tan \left (d x +c \right )-i\right )^{4}}-\frac {1}{4 d \,a^{4} \left (\tan \left (d x +c \right )-i\right )^{3}}-\frac {1}{16 d \,a^{4} \left (\tan \left (d x +c \right )-i\right )}\) | \(95\) |
norman | \(\frac {-\frac {i \left (\tan ^{4}\left (d x +c \right )\right )}{d a}-\frac {x}{16 a}-\frac {9 \left (\tan ^{5}\left (d x +c \right )\right )}{16 a d}-\frac {\tan ^{7}\left (d x +c \right )}{16 a d}-\frac {x \left (\tan ^{2}\left (d x +c \right )\right )}{4 a}-\frac {3 x \left (\tan ^{4}\left (d x +c \right )\right )}{8 a}-\frac {x \left (\tan ^{6}\left (d x +c \right )\right )}{4 a}-\frac {x \left (\tan ^{8}\left (d x +c \right )\right )}{16 a}+\frac {\tan \left (d x +c \right )}{16 a d}+\frac {9 \left (\tan ^{3}\left (d x +c \right )\right )}{16 a d}}{\left (1+\tan ^{2}\left (d x +c \right )\right )^{4} a^{3}}\) | \(159\) |
Time = 0.23 (sec) , antiderivative size = 43, normalized size of antiderivative = 0.37 \[ \int \frac {\tan ^2(c+d x)}{(a+i a \tan (c+d x))^4} \, dx=-\frac {{\left (8 \, d x e^{\left (8 i \, d x + 8 i \, c\right )} - 4 i \, e^{\left (4 i \, d x + 4 i \, c\right )} + i\right )} e^{\left (-8 i \, d x - 8 i \, c\right )}}{128 \, a^{4} d} \]
-1/128*(8*d*x*e^(8*I*d*x + 8*I*c) - 4*I*e^(4*I*d*x + 4*I*c) + I)*e^(-8*I*d *x - 8*I*c)/(a^4*d)
Time = 0.20 (sec) , antiderivative size = 117, normalized size of antiderivative = 1.01 \[ \int \frac {\tan ^2(c+d x)}{(a+i a \tan (c+d x))^4} \, dx=\begin {cases} \frac {\left (128 i a^{4} d e^{8 i c} e^{- 4 i d x} - 32 i a^{4} d e^{4 i c} e^{- 8 i d x}\right ) e^{- 12 i c}}{4096 a^{8} d^{2}} & \text {for}\: a^{8} d^{2} e^{12 i c} \neq 0 \\x \left (\frac {\left (- e^{8 i c} + 2 e^{4 i c} - 1\right ) e^{- 8 i c}}{16 a^{4}} + \frac {1}{16 a^{4}}\right ) & \text {otherwise} \end {cases} - \frac {x}{16 a^{4}} \]
Piecewise(((128*I*a**4*d*exp(8*I*c)*exp(-4*I*d*x) - 32*I*a**4*d*exp(4*I*c) *exp(-8*I*d*x))*exp(-12*I*c)/(4096*a**8*d**2), Ne(a**8*d**2*exp(12*I*c), 0 )), (x*((-exp(8*I*c) + 2*exp(4*I*c) - 1)*exp(-8*I*c)/(16*a**4) + 1/(16*a** 4)), True)) - x/(16*a**4)
Exception generated. \[ \int \frac {\tan ^2(c+d x)}{(a+i a \tan (c+d x))^4} \, dx=\text {Exception raised: RuntimeError} \]
Time = 0.90 (sec) , antiderivative size = 83, normalized size of antiderivative = 0.72 \[ \int \frac {\tan ^2(c+d x)}{(a+i a \tan (c+d x))^4} \, dx=-\frac {\frac {2 i \, \log \left (\tan \left (2 \, d x + 2 \, c\right ) + i\right )}{a^{4}} - \frac {2 i \, \log \left (\tan \left (2 \, d x + 2 \, c\right ) - i\right )}{a^{4}} + \frac {3 i \, \tan \left (2 \, d x + 2 \, c\right )^{2} - 6 \, \tan \left (2 \, d x + 2 \, c\right ) + 5 i}{a^{4} {\left (\tan \left (2 \, d x + 2 \, c\right ) - i\right )}^{2}}}{128 \, d} \]
-1/128*(2*I*log(tan(2*d*x + 2*c) + I)/a^4 - 2*I*log(tan(2*d*x + 2*c) - I)/ a^4 + (3*I*tan(2*d*x + 2*c)^2 - 6*tan(2*d*x + 2*c) + 5*I)/(a^4*(tan(2*d*x + 2*c) - I)^2))/d
Time = 4.73 (sec) , antiderivative size = 92, normalized size of antiderivative = 0.79 \[ \int \frac {\tan ^2(c+d x)}{(a+i a \tan (c+d x))^4} \, dx=-\frac {x}{16\,a^4}+\frac {\frac {\mathrm {tan}\left (c+d\,x\right )}{16\,a^4}-\frac {{\mathrm {tan}\left (c+d\,x\right )}^3}{16\,a^4}+\frac {{\mathrm {tan}\left (c+d\,x\right )}^2\,1{}\mathrm {i}}{4\,a^4}}{d\,\left ({\mathrm {tan}\left (c+d\,x\right )}^4-{\mathrm {tan}\left (c+d\,x\right )}^3\,4{}\mathrm {i}-6\,{\mathrm {tan}\left (c+d\,x\right )}^2+\mathrm {tan}\left (c+d\,x\right )\,4{}\mathrm {i}+1\right )} \]